<template>
	<view>
		<!-- 无商品维护页面 -->
		<view v-if="!dataswitch"><u-empty style="top:340rpx;position: relative;" text="暂无数据"></u-empty></view>

		<view class="container" v-if="dataswitch">
			<!-- 瀑布流商品列表 -->
			<view class="centergoods">
				<view class="news-box" v-for="(item,index) in goodsList" :key="index" @click="onnews">
					<image src="https://images4.jyimg.com/w4/story/i/love/46413a3486_322x322.jpg" class="imga" mode="">
					</image>
					<view class="news-title">
						你想了解我们如何相遇的么？
					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex';
	export default {
		computed: {
			...mapGetters(['imgBaseUrl'])
		},
		data() {
			return {
				url: 'https://peonyoss.longchimudan.com', //阿里oss地址
				goodsList: [{
						id: '1'
					},
					{
						id: '2'
					},
					{
						id: '3'
					}
				],
				dataswitch: true
			};
		},
		computed: {},
		created() {},

		methods: {
			onnews(item) {
				uni.navigateTo({
					url: '../../pages/news-detail/index',
				})
				console.log(item, '点击了商品，这里要跳转详情页');
			}
		}
	};
</script>

<style lang="scss">
	@import '@/styles/mixin.scss';

	.container {
		width: 100%;
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		background-color: #f5f5f5;
		z-index: 6;
		margin-top: 20rpx;

		.centergoods {
			padding: 10rpx;
			background-color: #f5f5f5;
			width: 100%;
			box-sizing: border-box;
			border-radius: 30rpx;

			.news-box {
				position: relative;

				.imga {
					width: 100%;
					height: 300rpx;
					background-color: black;
					border-radius: 15rpx;
				}

				.news-title {
					color: #fff;
					position: absolute;
					bottom: 10rpx;
					padding: 10rpx;
					text-align: center;
					width: 100%;
					border-radius: 10rpx;
					background-color: rgba(0, 0, 0, 0.3);
					// background-color: #fff;

				}

			}
		}

	}
</style>